define(['app'],function(app){return {module: function($scope, $http, eventBusService, httpService, params, configService) {
	$scope.row_current = {};
	$scope.row_current.id = params.currentMenu;
	
	$scope.warehouse = function(row){
		for(var i = 0 ; i < $scope.rows.length ; i++){
			if($scope.rows[i].id == row.id){
				$("."+row.id+"_menu").addClass("vertical-active");
			}else{
				$("."+$scope.rows[i].id+"_menu").removeClass("vertical-active");
			}
		}
		var menu = {"url":row.path+"?father_id="+row.id};
		
		$scope.defaultModeul = app.include(menu.url);
		
	}
	
    $scope.findmenu = function () {
        $scope.rows = app.urls.menus;
        if($scope.rows != undefined) {
    		for (var int = 0; int < $scope.rows.length; int++) {
    			if($scope.rows[int].father_id === $scope.row_current.id){
    				$scope.warehouse($scope.rows[int]);
    				break;
    			}
    		}
        }
    }
    $scope.findmenu();
	
	//接收模块变更
	eventBusService.subscribe('modules.welcome.load', function(event,data) {
		$scope.defaultModeul = app.include(data.url);
    });
}}});